Fix: Add accessibility attributes to UI Kit card images and icons#69
Open
huangkevin-apr wants to merge 1 commit intonativewind:mainfrom
Open
Fix: Add accessibility attributes to UI Kit card images and icons#69huangkevin-apr wants to merge 1 commit intonativewind:mainfrom
huangkevin-apr wants to merge 1 commit intonativewind:mainfrom
Conversation
|
@huangkevin-apr is attempting to deploy a commit to the nativewind Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses 6 accessibility violations identified by IBM Equal Access Accessibility Checker in the UI Component Kits section of the website homepage. The fixes ensure proper alternative text for preview images and appropriate labeling for decorative external link icons, bringing the component into full WCAG Level A compliance.
Problem
Missing Image Alt Text (3 violations -
img_alt_valid)Preview images for NativewindUI, React Native Reusables, and gluestack lacked alternative text, making them inaccessible to screen reader users.
Missing SVG Accessible Names (3 violations -
svg_graphics_labelled)External link icons (ExternalLink component from Lucide React) within the card headings lacked accessible names, preventing screen reader users from understanding their purpose.
Solution
Image Alt Text
Added dynamic alt attribute to preview images using the title prop, providing meaningful context:
This ensures each preview image has descriptive alternative text (e.g., "NativewindUI", "React Native Reusables", "gluestack") that conveys the content's purpose to screen reader users.
External Link Icon Labeling
Added
aria-label="Opens in a new tab"to the ExternalLink icon component:This provides screen reader users with clear information about the icon's function without redundancy, since the link destination is already conveyed by the adjacent title text.
Changes
Fix Before:

Fix After:

Testing
✅ Verified with IBM Equal Access Accessibility Checker
✅ All 3
img_alt_validviolations resolved✅ All 3
svg_graphics_labelledviolations resolved✅ Screen reader testing: Images properly announced with context, external link icons provide clear action indication
✅ Visual appearance unchanged
Additional Info
The patch submitted in this PR was generated by A11YRepair, an automated Web Accessibility repair tool that I developed to address common accessibility violations in web applications. The generated fixes were manually reviewed and validated before submission.